#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+5,mod=1e9+7;
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-1;ch-getchar();}
    while(isdigit(ch)){x=(x<<1)+(x<<3)+ch-48,ch=getchar();}
    return x*f;
}
int n,k,a[N],f[N][15],inv=1,ans;

inline int ksm(int x,int y){
    int res=1;
    while(y){
        if(y&1) res=res*x%mod;
        x=x*x%mod;
        y>>=1;
    }
    return res;
}

signed main(){
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    cin>>n>>k;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=n-k;i<n;i++) inv=inv*i%mod;
    inv=ksm(inv,mod-2);
    for(int i=1;i<=min(10ll,n);i++) f[n-k][i]=1;
    for(int i=n-k+1;i<=n;i++)
        for(int j=1;j<=min(10ll,i);j++)
            f[i][j]=(f[i-1][j]*(i-j+mod)%mod+f[i-1][j-1]*(j-1)%mod+f[i-1][j-1]*(mod-2)%mod)%mod;
    for(int i=1;i<=n;i++) ans=(ans+a[i]*f[n][min(10ll,i)]%mod)%mod;
    cout<<ans*inv%mod;
    return 0;
}